<?php
namespace app\common\model;

class Hall extends Base
{
    protected $name = 'hall';
    protected $updateTime = false;

    public function getStatusAttr($val)
    {
        $status = [1 => '待开始', 2 => '进行中', 3 => '已结束'];
        return $status[$val];
    }

    public function getTypeAttr($val)
    {
        $type = [1 => '君子堂', 2 => '淑女堂'];
        return $type[$val];
    }

    public function getHeadImgAttr($val)
    {
        if(!$val){
            return '';
        }

        return config('app.url') . $val;
    }

    public function getStartTimeAttr($val)
    {
        if(!$val){
            return '-';
        }

        return date('Y-m-d', $val);
    }

    public function getEndTimeAttr($val)
    {
        if(!$val){
            return '-';
        }

        return date('Y-m-d', $val);
    }
}